{extend name="default/template/base_index" /}


{block name="area_header"}

	<script src="__CDN__jquery-validation/1.13.1/jquery.validate.min.js"></script>
	<script src="__CDN__jquery-validation/1.13.1/localization/messages_zh.min.js"></script>
	<link src="__CDN__bootstrap-touchspin/jquery.bootstrap-touchspin.min.css" rel="stylesheet" type="text/css" />
	<script src="__CDN__bootstrap-touchspin/jquery.bootstrap-touchspin.min.js"></script>
{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
			<!-- form -->

			<form class="form-horizontal well validateForm">
				<fieldset>
					<legend>
						{:L('C_CONFIG')}-{:L('BTN_EDIT')}</legend><small class="help-block">
				{:L('TIP_CONFIG_CHANGE_MUST_CLEAR_CACHE')}
			</small>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">{:L('TITLE')}</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short"  name="title" id="inputtitle" value="{$entity.title}" placeholder="{:L('PLACEHOLDER_TITLE')}">
						<div class="help-block">({:L('M_CONFIG_TITLE_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputname" class="col-md-2 col-lg-2 control-label">{:L('M_CONFIG_NAME')}</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short"  name="name" value="{$entity.name}" id="inputname" placeholder="{:L('PLACEHOLDER_NAME')}">
						<div class="help-block">({:L('M_CONFIG_NAME_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="selectgroup" class="col-md-2 col-lg-2 control-label">{:L('M_CONFIG_GROUP')}</label>

						<div class="col-md-10 col-lg-10">
							<select id="selecttype" class="form-control input-short"  name="group">
								<option  value="0" {eq name="entity.group" value="0"} selected="selected"{/eq} >不分组</option>
								{volist name="config_groups" id="vo"}

									<option value="{$key}" {eq name="entity.group" value="$key"}selected="selected"{/eq} >{$vo}</option>
								{/volist}
							</select>
						<div class="help-block">({:L('M_CONFIG_GROUP_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="selecttype" class="col-md-2 col-lg-2 control-label">{:L('M_CONFIG_TYPE')}</label>
						<div class="col-md-10 col-lg-10">

							<select id="selecttype" class="form-control input-short" name="type">
								{volist name="config_types" id="vo"}
								<option {eq name="entity.type" value="$key"} selected="selected" {/eq} value="{$key}">{$vo}</option>
								{/volist}
							</select>
						<div class="help-block">({:L('M_CONFIG_TYPE_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputvalue" class="col-md-2 col-lg-2 control-label">{:L('M_CONFIG_VALUE')}</label>
						<div class="col-md-10 col-lg-10">
							<textarea name="value" id="inputvalue" rows="5" class=" form-control input-normal"  >{$entity.value}</textarea>
						<div class="help-block">({:L('M_CONFIG_VALUE_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputextra" class="col-md-2 col-lg-2 control-label">{:L('M_CONFIG_EXTRA')}</label>
						<div class="col-md-10 col-lg-10"><textarea rows="5" name="extra" id="inputextra"  class="form-control input-normal"  >{$entity.extra}</textarea>
						<div class="help-block">({:L('M_CONFIG_EXTRA_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputremark" class="col-md-2 col-lg-2 control-label">{:L('M_CONFIG_REMARK')}</label>
						<div class="col-md-10 col-lg-10 ">
							<textarea class="form-control input-normal" rows="3" name="remark">{$entity.remark}</textarea>
						<div class="help-block">({:L('M_CONFIG_REMARK_HELP')})</div>

						</div>
					</div>
					<div class="form-group">
						<label for="inputsort" class="col-md-2 col-lg-2 control-label">{:L('SORT')}</label>
						<div class="col-md-10 col-lg-10 input-number">
							<input type="text" class="required form-control

							 input-number" id="inputsort" name="sort" value="{$entity.sort}">

						<div class="help-block">({:L('M_CONFIG_SORT_HELP')})</div>
						</div>
					</div>
					<div class="form-group">
						<label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
						<div class="col-lg-10 col-md-10">
							<a target-form="validateForm" class="ajax-post btn btn-primary" href="{:url(''.CONTROLLER_NAME.'/save',array('id'=>$entity['id']))}" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
							<a class="btn btn-primary" href="{:url(''.CONTROLLER_NAME.'/index')}"><i class="fa fa-times-circle"></i> {:L('BTN_CANCEL')}</a>
						</div>
					</div>
				</fieldset>
			</form>
			<!-- form -->
		</div>

	</div>
{/block}

{block name="area_footer"}
	<script>
		$(function() {
			$("#inputsort").TouchSpin({
				initval: 0
			});
			$(".validateForm").validate();
		})
	</script>
{/block}